<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>管理员控制台</title>
    <link rel="stylesheet" href="../static/css/bootstrap.min.css">
    <link rel="stylesheet" href="../static/css/fileinput.min.css"/>
</head>
<body>

<nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">控制台</a>
        </div>
        <div>
            <ul class="nav navbar-nav">
                <li class="dropdown active">
                    <a class="dropdown-toggle" data-toggle="dropdown">
                        用户管理<span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a data-toggle="modal" data-target="#myModal">从excel文件中创建用户</a></li>
                        <!--<li class="divider"></li>-->
                        <!--<li><a href="#">分离的链接</a></li>-->
                    </ul>
                </li>
                <li><a href="/context">工厂故障监测</a></li>
                <li><a href="/faultInfo">故障记录</a></li>
            </ul>
        </div>
        <ul class="nav navbar-nav navbar-right">
            <li><p class="navbar-text">{{ login_user }} 用户登录</p></li>
            <li><a href="/logout"><span class="glyphicon glyphicon-log-out"></span> 注销</a></li>
        </ul>
        <form class="navbar-form pull-left" action="/searchUser" method="post" onsubmit="return controlAction()">
            <input type="text" class="span2" name="username" id="searchText">
            <button type="submit" class="btn">查询用户</button>
        </form>
    </div>
</nav>

<div>
    <table class="table table-condensed;">
        <thead>
        <tr>
            <th>用户名</th>
            <th>密码</th>
        </tr>
        </thead>
        <tbody>
        {% for item in results %}
            <tr>
                {% for i in item %}
                    <td>{{ i }}</td>
                {% endfor %}
                <td>
                    <button type="button" class="btn btn-danger" name="{{ item[0] }}">删除</button>
                </td>
                <td>
                    <button type="button" class="btn btn-info" name="{{ item[0] }}">重置密码</button>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
</div>

<div style="text-align: center">
    <p>共查询到{{ length }}条记录 </p>
    {% if show_btn%}
        <button class="btn btn-info" onclick="window.location.href='/control'">展示全部</button>
    {% endif %}
</div>
<div style="text-align: center">
    {{ paginate.links }}
</div>
<!--弹出层-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <input id="input-id" name="file" type="file" data-show-caption="true" accept=".xls,.xlsx">
            </div>
        </div>
    </div>
</div>
<script src="../static/js/jquery-1.10.2.js"></script>
<script src="../static/js/commonUtil.js"></script>
<script src="../static/js/bootstrap.min.js"></script>
<script src="../static/js/checkIsEmpty.js"></script>
<script src="../static/js/fileinput.min.js"></script>
<!--中文包-->
<script src="../static/js/zh.js"></script>
<script src="../static/js/userManager.js"></script>
<script src="../static/js/registerUser.js"> </script>
</body>
</html>
